import  pymysql
connect = pymysql.connect(user='root',password='root',host='localhost',database='school',charset='utf8')
cursor=connect.cursor()
sql="selct * fromstudents limit 2"
cursor.execute(sql)
cursor.fetchone()
result=cursor.fetchall()
print(result)
cursor.close()
